<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>transfer</title>
    <script type="text/javascript" src="{{url_for('static',filename='res/js/jquery.min.js')}}"></script>
</head>
<body>
    transfer转账  <br>
    转账类型： 挖矿收益=》钱包  <br>
    钱包地址： <input type="text" name="wallet_code" id="wallet_code">  <br>
    发送数量： <input type="text" name="number" id="number">  <br>
    交易密码： <input type="text" name="pwd" id="pwd">  <br>

    <input type="button" value="确认转账" onclick="transfer()">
    
<div id="message"></div>
<script>
function transfer(){
    var wallet_code = document.getElementById("wallet_code").value;
    var number = document.getElementById("number").value;
    var pwd = document.getElementById("pwd").value;

    var postdata = {
        'wallet_code':wallet_code,
        'number':number,
        'pwd':pwd,
        'csrf_token': "{{csrf_token()}}"
    };


    $.ajax({
       url: '{{url_for("finance.wallet_transfer")}}',
       type: 'POST',
       data: postdata,
       success: function( data ) {
        var msg_html = '';
        msg_html += '<br>success:'+data.success+msg_html;
        msg_html += '<br>channel:'+data.channel;
        msg_html += '<br>ts:'+data.ts;
        document.getElementById('message').innerHTML = '<br>'+data.msg+msg_html+document.getElementById('message').innerHTML;
       }
    });
}    

</script>
</body>
</html>